<template>
  <div class="mainContainer">
    <el-container class="container">
      <el-header class="header">
        <div class="button"><span>设置</span></div>
        <div class="button"><span>关于</span></div>
      </el-header>
      <el-container>
        <el-aside class="aside">
          <div class="notice" v-for='(data, i) in datas' @click="index = i">
            <span v-text="data.title"></span>
          </div>
        </el-aside>
        <el-main class="main">
          <right :data="datas[index]"></right>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import axios from 'axios'
import right from './right'

export default {
  name: 'index',
  data () {
    return {
      datas: null,
      index: 0
    }
  },
  components: {
    right: right
  },
  created () {
    axios
      .get('http://192.168.0.41:8080/allData')
      .then(resp => {
        alert(resp.data)
        this.datas = resp.data.data
      })
  }
}
</script>

<style src="../style/index.less" lang="less"></style>
